package com.moss.cloud.common.mongo.utils;

import com.anwen.mongo.model.PageParam;
import java.util.Objects;

/**
 * 分页工具
 *
 * @author 瑾年
 * {@code @date} 2023年4月9日
 */
public class PageUtil {

    public static PageParam createPage(Integer current, Integer size) {
        if (Objects.isNull(current)) {
            current = 1;
        }
        if (Objects.isNull(size)) {
            size = 10;
        }
        PageParam pageParam = new PageParam();
        pageParam.setPageNum(current);
        pageParam.setPageSize(size);
        return pageParam;
    }
}
